package com.hyts.network.server;


import com.hyts.network.base.ServerFactoryBean;
import com.hyts.network.config.DefaultNetwork;

import java.io.IOException;
import java.net.ServerSocket;

/**
 * project-name:gitee-extends-toolbox
 * package-name:com.hyts.ext.network.server
 * author:Libo/Alex
 * create-date:2018-10-27 13:00
 * copyright:libo-hyts-github
 * email:libo2dev@aliyun.com
 * description:此类主要用于:
 */
public abstract class BaseServerFactoryBean<T> extends ServerFactoryBean<ServerSocket> {


    private T threadPool;


    public BaseServerFactoryBean() throws IOException {
        super(new ServerSocket(DefaultNetwork.DEFAULT_NETWORK_LOCAL_PORT));
    }

    public BaseServerFactoryBean(int port, ServerSocket server) {
        super(port, server);
    }

    public BaseServerFactoryBean(ServerSocket server) {
        super(server);
    }


    public BaseServerFactoryBean(ServerSocket server, int singleCpuThreadNum, int tryReconnectedTimes) {
        super(server, singleCpuThreadNum, tryReconnectedTimes);
    }

    public BaseServerFactoryBean(ServerSocket server, int singleCpuThreadNum) {
        super(server, singleCpuThreadNum);
    }

    public BaseServerFactoryBean(int port, ServerSocket server, T threadPool) {
        super(port, server);
        this.threadPool = threadPool;
    }

    public BaseServerFactoryBean(ServerSocket server, T threadPool) {
        super(server);
        this.threadPool = threadPool;
    }

    public BaseServerFactoryBean(ServerSocket server, int singleCpuThreadNum, int tryReconnectedTimes, T threadPool) {
        super(server, singleCpuThreadNum, tryReconnectedTimes);
        this.threadPool = threadPool;
    }

    public BaseServerFactoryBean(ServerSocket server, int singleCpuThreadNum, T threadPool) {
        super(server, singleCpuThreadNum);
        this.threadPool = threadPool;
    }

    public T getThreadPool() {
        return threadPool;
    }

    public void setThreadPool(T threadPool) {
        this.threadPool = threadPool;
    }


}
